floorDecimal

Reduce the precision of a floating point. Useful for displaying on screen

pure @safe nothrow @nogc @nogc nothrow pure @safe
T
floorDecimal
(
T
)
(,
ubyte precision = 2
)
if (
__traits(isFloating, T)
)

Parameters

value T

Some floating input value, e.g: 5.59367

precision ubyte

The precision which must be seen, for example 2

Return Value

Type: T

An approximated floating value, for those inputs, return 5.93

Meta